﻿using StudySystem.MainLogic.FormControl;
using StudySystem.MainLogic.Items;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace StudySystem
{
    public partial class FormEnter : Form
    {
        public FormEnter()
        {
            InitializeComponent();
        }

        private void btnEnter_Click(object sender, EventArgs e)
        {
            UserInformation user = new UserInformation();
            bool result = user.CheckID(textBoxID.Text, textBoxPW.Text);
            //bool result = Logic.CheckEnter(textBoxID.Text,textBoxPW.Text);
            if(result)
            {
                user.UserRightEnter();
                FormUserController.RightEnter(this, user.GetSubjectsOfUser());
                //Logic.RightEnter();
                //this.Hide();
            }
            else
            {
                FormUserController.WrongEnter(this);
            }
            
        }

        private void FormEnter_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Application.Exit();
        }

        private void FormEnter_Load(object sender, EventArgs e)
        {

        }
    }
}
